﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:c="clr-namespace:Tanmia.Basis.Prism">
    <Color x:Key="MainColor">White</Color>
    <Color x:Key="LightColor">#FF8ACA06</Color>
    <Color x:Key="BackgroundLightColor">#5D8ACA06</Color>
    <Color x:Key="DarkColor">Green</Color>
    <Color x:Key="ForegroundColor">#FF007000</Color>
    <Color x:Key="FontColor">#BD003400</Color>

    <SolidColorBrush x:Key="MainBrush" Color="{StaticResource MainColor}" />
    <SolidColorBrush x:Key="LightBrush" Color="{StaticResource LightColor}" />
    <SolidColorBrush x:Key="BackgroundLightBrush" Color="{StaticResource BackgroundLightColor}" />
    <SolidColorBrush x:Key="BtnMouseOver" Color="#FFFFAF00" />
    <!--<SolidColorBrush x:Key="ForegroundBrush" Color="#FF696969" />-->
    <SolidColorBrush x:Key="ForegroundBrush" Color="{StaticResource ForegroundColor}" />
    <SolidColorBrush x:Key="DarkBrush" Color="Green" />
    <SolidColorBrush x:Key="FontBrush" Color="{StaticResource FontColor}" />

    <SolidColorBrush x:Key="DisabledForegroundBrush" Color="Black" />
    <SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#FFEEEEEE" />

    <SolidColorBrush x:Key="ErrorLightBrush" Color="Red" />


    <SolidColorBrush x:Key="DisabledBorderBrush" Color="{StaticResource DarkColor}" />

    <Color x:Key="SelecteBackgroundColor">#5D8ACA06</Color>

    <Style x:Key="{x:Type TextBox}" TargetType="{x:Type TextBox}">
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="MinHeight" Value="23" />
        <Setter Property="AllowDrop" Value="True" />
        <Setter Property="Foreground" Value="{StaticResource ForegroundBrush}" />
        <Setter Property="Margin" Value="0,2,2,2" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TextBox">
                    <Border Name="Border" CornerRadius="4" Padding="2" 
                                Background="{StaticResource MainBrush}"
                                BorderBrush="{StaticResource LightBrush}"
                                BorderThickness="1">
                        <ScrollViewer Margin="0" x:Name="PART_ContentHost" />
                    </Border>
                    <!--<Image Name="ErrorIcon" VerticalAlignment="Top" HorizontalAlignment="Right" Width="16" Height="16" Margin="0,-8,-8,0" Source="/WpfApplication1;component/ErrorImage.jpg" Opacity="0" ToolTip="{Binding Path=(Validation.Errors)[0].ErrorContent}" />-->
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource LightBrush}" />
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
                        </Trigger>
                        <Trigger Property="Validation.HasError" Value="True">
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource ErrorLightBrush}" />
                            <Setter Property="Foreground" Value="{StaticResource ErrorLightBrush}" />
                            <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Border" Property="CornerRadius" Value="0" />
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter TargetName="Border" Property="CornerRadius" Value="0" />
                        </Trigger>
                        <!--<Trigger Property="Validation.HasError" Value="True">
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource ErrorLightBrush}" />
                            <Setter Property="Foreground" Value="{StaticResource ErrorLightBrush}" />
                            <Setter TargetName="ErrorIcon" Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}" />
                            <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}" />
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ColorAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="BorderBrush" From="#FF8ACA06" To="Red" Duration="00:00:.5" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="ErrorIcon" Storyboard.TargetProperty="Opacity" From="1.0" To="0.0" Duration="00:00:.5" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>-->
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Validation.ErrorTemplate">
            <Setter.Value>
                <ControlTemplate TargetType="Control"></ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ButtonFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border CornerRadius="4" BorderThickness="1" BorderBrush="{StaticResource LightBrush}">
                        <Rectangle x:Name="MyBorder" Margin="0" StrokeThickness="1" Stroke="{StaticResource LightBrush}" StrokeDashArray="2 4" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Type Button}" TargetType="{x:Type Button}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
        <Setter Property="MinHeight" Value="23"/>
        <Setter Property="MinWidth" Value="75"/>
        <Setter Property="Foreground" Value="{StaticResource DarkBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border x:Name="Border" CornerRadius="4" BorderThickness="1" Background="{StaticResource MainBrush}" BorderBrush="{StaticResource LightBrush}">
                        <ContentPresenter Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsDefaulted" Value="True">
                            <Setter TargetName="Border" Property="Background" Value="#5D8ACA06" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Border" Property="CornerRadius" Value="0" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource LightBrush}" />
                            <Setter Property="Foreground" Value="{StaticResource MainBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Type Label}" TargetType="{x:Type Label}">
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="FontFamily" Value="Tahoma" />
        <Setter Property="Foreground" Value="{StaticResource ForegroundBrush}" />
    </Style>

    <Style x:Key="{x:Type UserControl}" TargetType="{x:Type UserControl}">
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
    </Style>

    <Style x:Key="OperationMenuButton" TargetType="{x:Type Button}" BasedOn="{x:Null}">
        <Setter Property="Padding" Value="10" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border x:Name="RootElement" BorderThickness="0" Background="{StaticResource MainBrush}" BorderBrush="{StaticResource LightBrush}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup Name="CommonStates">
                                <VisualState Name="Normal" />
                                <VisualState Name="MouseOver">
                                    <Storyboard>
                                        <ColorAnimation Storyboard.TargetName="RootElement" Duration="00:00:0.5" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" To="{StaticResource BackgroundLightColor}" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState Name="Pressed">
                                    <Storyboard>
                                        <ColorAnimation Storyboard.TargetName="RootElement" Duration="00:00:0.5" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" To="{StaticResource LightColor}" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentPresenter  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" RecognizesAccessKey="True"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="RootElement" Property="Background" Value="#FFEFEFEF" />
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="WindowStyle" TargetType="{x:Type c:BaseWindow}">
        <Setter Property="FlowDirection" Value="RightToLeft" />
        <Setter Property="Padding" Value="5" />
        <Setter Property="WindowStyle" Value="None" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
    </Style>

    <Style x:Key="{x:Type TabItem}" TargetType="{x:Type TabItem}">
        <Setter Property="Header" Value="{Binding Path=DataContext.ViewInfo.Title}" />
        <Setter Property="Foreground" Value="{StaticResource FontBrush}" />
        <Setter Property="FontFamily" Value="mohammad art 1" />
        <Setter Property="FontSize" Value="14" />
        <!--<Setter Property="FontWeight" Value="Bold" />-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected">
                                    <Storyboard>
                                        <ColorAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" To="Silver" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Selected" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
                                            <EasingColorKeyFrame KeyTime="0" Value="{StaticResource BackgroundLightColor}" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
                                            <EasingColorKeyFrame KeyTime="0" Value="{StaticResource DarkColor}"/>
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Border" Height="32" Margin="4,0,0,0" Padding="8,0" BorderThickness="1,4,1,0" VerticalAlignment="Bottom" BorderBrush="{StaticResource LightBrush}" Background="{StaticResource MainBrush}">
                            <ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Header" RecognizesAccessKey="True" />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Panel.ZIndex" Value="100" />
                            <Setter TargetName="Border" Property="Height" Value="39" />
                        </Trigger>
                        <Trigger Property="IsSelected" Value="False">
                            <Setter TargetName="Border" Property="Height" Value="32" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="ComboBoxToggleButton" TargetType="ToggleButton">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="20" />
            </Grid.ColumnDefinitions>
            <Border x:Name="Border" Grid.ColumnSpan="2" CornerRadius="4" BorderThickness="1" Margin="0" 
                    Background="{StaticResource MainBrush}" BorderBrush="{StaticResource LightBrush}" />

            <Border x:Name="TextBorder" Grid.Column="0" CornerRadius="4,0,0,4" Margin="1" BorderThickness="0" Background="{StaticResource MainBrush}" />

            <Border x:Name="GlyphBorder" Grid.Column="1" CornerRadius="0,4,4,0" BorderThickness="1" Margin="0,2,2,2" BorderBrush="{StaticResource LightBrush}">
                <Path x:Name="Arrow" Fill="{StaticResource LightBrush}" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 0 0 L 4 4 L 8 0 Z" />
            </Border>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="ToggleButton.IsMouseOver" Value="True">
                <Setter TargetName="Border" Property="CornerRadius" Value="0" />
                <Setter TargetName="GlyphBorder" Property="CornerRadius" Value="0" />
            </Trigger>
            <Trigger Property="ToggleButton.IsChecked" Value="true">
                <Setter TargetName="GlyphBorder" Property="Background" Value="{StaticResource LightBrush}" />
                <Setter TargetName="Arrow" Property="Fill" Value="{StaticResource MainBrush}" />
                <Setter TargetName="Border" Property="CornerRadius" Value="4,4,0,0" />
                <Setter TargetName="GlyphBorder" Property="CornerRadius" Value="0,4,0,0" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource LightBrush}" />
                <Setter TargetName="TextBorder" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                <Setter TargetName="Arrow" Property="Fill" Value="{StaticResource DisabledForegroundBrush}" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <ControlTemplate x:Key="ComboBoxTextBox" TargetType="TextBox">
        <Border x:Name="PART_ContentHost" Focusable="False" Background="{StaticResource MainBrush}" />
    </ControlTemplate>

    <Style x:Key="{x:Type ComboBox}" TargetType="ComboBox">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="MinWidth" Value="120"/>
        <Setter Property="MinHeight" Value="23"/>
        <Setter Property="Foreground" Value="{StaticResource DarkBrush}" />
        <Setter Property="Margin" Value="0,2,2,2" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ComboBox">
                    <Grid>
                        <ToggleButton Name="ToggleButton" Grid.Column="2" Focusable="false" ClickMode="Press" Template="{StaticResource ComboBoxToggleButton}" IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
                        <ContentPresenter Name="ContentSite" IsHitTestVisible="False" Margin="3,3,23,3" HorizontalAlignment="Left" VerticalAlignment="Center" 
                                              Content="{TemplateBinding SelectionBoxItem}"
                                              ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
                                              ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" />

                        <TextBox x:Name="PART_EditableTextBox" Style="{x:Null}" Margin="3,3,23,3" Focusable="True" Visibility="Hidden" HorizontalAlignment="Left" VerticalAlignment="Center" IsReadOnly="{TemplateBinding IsReadOnly}"
                                     Template="{StaticResource ComboBoxTextBox}" Background="{StaticResource MainBrush}" Foreground="{StaticResource ForegroundBrush}"  />

                        <Popup Name="Popup" AllowsTransparency="True" Focusable="False" Placement="Bottom" PopupAnimation="Fade" IsOpen="{TemplateBinding IsDropDownOpen}">
                            <Grid Name="DropDown" SnapsToDevicePixels="True" MinWidth="{TemplateBinding ActualWidth}" MaxHeight="{TemplateBinding MaxDropDownHeight}">
                                <Border x:Name="DropDownBorder" Background="{StaticResource MainBrush}" BorderThickness="1" BorderBrush="{StaticResource LightBrush}" />
                                <ScrollViewer Margin="0,2,0,6" SnapsToDevicePixels="True">
                                    <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
                                </ScrollViewer>
                            </Grid>
                        </Popup>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasItems" Value="false">
                            <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                        <Trigger Property="IsGrouping" Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                        </Trigger>
                        <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="True">
                            <Setter TargetName="DropDownBorder" Property="CornerRadius" Value="0,0,4,4"/>
                            <Setter TargetName="DropDownBorder" Property="Margin" Value="0,-1,0,0"/>
                        </Trigger>
                        <Trigger Property="IsEditable" Value="True">
                            <Setter Property="IsTabStop" Value="False"/>
                            <Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible"/>
                            <Setter TargetName="ContentSite" Property="Visibility" Value="Hidden"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Type ComboBoxItem}" TargetType="ComboBoxItem">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ComboBoxItem">
                    <Border Name="Border" Padding="2,0,2,0" SnapsToDevicePixels="True">
                        <ContentPresenter />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsHighlighted" Value="True">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource LightBrush}"/>
                            <Setter Property="Foreground" Value="{StaticResource MainBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ModuleHeaderStyle" TargetType="{x:Type TreeViewItem}">
        <Setter Property="Background" Value="{StaticResource ResourceKey=MainBrush}" />
        <Setter Property="Foreground" Value="{StaticResource ResourceKey=ForegroundBrush}" />
        <Setter Property="FontSize" Value="22" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TreeViewItem}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <!--<ColumnDefinition MinWidth="19" Width="Auto" />-->
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition />
                        </Grid.RowDefinitions>

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
                                            <EasingColorKeyFrame KeyTime="0" Value="{StaticResource ResourceKey=SelecteBackgroundColor}" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unselected" />
                                <VisualState x:Name="SelectedInactive" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ExpansionStates">
                                <VisualState x:Name="Expanded">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemsHost" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="Width">
                                            <EasingDoubleKeyFrame KeyTime="00:00:0.5" Value="165" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <!--<ColorAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:0.5" Value="#5D8ACA06" />
                                            </ColorAnimationUsingKeyFrames>-->
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Collapsed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="Width">
                                            <EasingDoubleKeyFrame KeyTime="00:00:0.5" Value="150" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <!--<ColorAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:0.5" Value="#FFFFFFFF" />
                                            </ColorAnimationUsingKeyFrames>-->
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border x:Name="Bd" Grid.Column="0" 
                                    CornerRadius="0,15,5,0" Margin="0,5,0,0" Padding="10,0,0,0" Width="150" Height="50"
                                    Background="{StaticResource MainBrush}" 
                                    BorderBrush="{StaticResource LightBrush}" 
                                    BorderThickness="0,5,5,5">
                            <ContentPresenter x:Name="PART_Header" ContentSource="Header" VerticalAlignment="Center" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
                        </Border>
                        <ItemsPresenter x:Name="ItemsHost" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" Visibility="Collapsed" />
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsExpanded" Value="True">
                            <Setter TargetName="Bd" Property="Background" Value="#5D8ACA06" />
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="HasHeader" Value="False" />
                                <Condition Property="Width" Value="Auto" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="PART_Header" Property="MinWidth" Value="75" />
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="HasHeader" Value="False" />
                                <Condition Property="Height" Value="Auto" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="PART_Header" Property="MinHeight" Value="19" />
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ModuleItemStyle" TargetType="{x:Type TreeViewItem}">
        <Setter Property="Background" Value="{StaticResource MainBrush}" />
        <Setter Property="Foreground" Value="{StaticResource ForegroundBrush}" />
        <Setter Property="FontSize" Value="12" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TreeViewItem}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition />
                        </Grid.RowDefinitions>

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Selected" />
                                <VisualState x:Name="Unselected" />
                                <VisualState x:Name="SelectedInactive" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Bd" Grid.Column="0" CornerRadius="0,10,5,0" Background="{StaticResource MainBrush}"
                                    BorderBrush="{StaticResource LightBrush}" BorderThickness="1" Width="150"
                                    Padding="10,2,0,2" Margin="2,2,0,0">
                            <ContentPresenter x:Name="PART_Header" ContentSource="Header" VerticalAlignment="Center" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Foreground" Value="{StaticResource MainBrush}" />
                            <Setter TargetName="Bd" Property="Background" Value="{StaticResource LightBrush}" />
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="HasHeader" Value="False" />
                                <Condition Property="Width" Value="Auto" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="PART_Header" Property="MinWidth" Value="75" />
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="HasHeader" Value="False" />
                                <Condition Property="Height" Value="Auto" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="PART_Header" Property="MinHeight" Value="19" />
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ModuleNavigatorStyle" TargetType="TreeView">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TreeView">
                    <Border Name="Border" CornerRadius="0" BorderThickness="0" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <ScrollViewer Focusable="False" CanContentScroll="False" Padding="0">
                            <ItemsPresenter />
                        </ScrollViewer>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Type StatusBar}" TargetType="{x:Type StatusBar}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type StatusBar}">
                    <Border BorderThickness="1" CornerRadius="0,0,4,4" Background="{StaticResource BackgroundLightBrush}" BorderBrush="{StaticResource LightBrush}" Padding="1">
                        <ItemsPresenter/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Type TabControl}" TargetType="{x:Type TabControl}">
        <Setter Property="BorderBrush" Value="{StaticResource LightBrush}" />
    </Style>
</ResourceDictionary>